#ifndef BM1880v2_TIU_REG_V2_11_H
#define BM1880v2_TIU_REG_V2_11_H

/*
 * This file is generated by tools. Do not edit it manually.
 */

#include <stdint.h>
#include <stdio.h>

typedef uint8_t uint8_t;
typedef uint64_t uint64_t;
typedef unsigned long long ullong;

typedef struct {
  uint32_t cmd_en;
  uint32_t cmd_end;
  uint32_t cmd_id_en;
  uint32_t cmd_id_tpu;
  uint32_t cmd_id_gdma;
  uint32_t cmd_keep;
  uint32_t cmd_intr_en;
  uint32_t tsk_typ;
  uint32_t tsk_eu_typ;
  uint32_t tsk_opd_num;
  uint32_t opt_right_shift;
  uint32_t opt_left_shift;
  uint32_t opt_shift_typ;
  uint32_t opt_rshift_typ;
  uint32_t opt_res_add;
  uint32_t opt_relu;
  uint32_t opt_left_tran;
  uint32_t opt_chl_quan;
  uint32_t tens_mdsum;
  uint32_t tens_lookup;
  uint32_t opt_res0_sign;
  uint32_t opt_opd0_sign;
  uint32_t opt_opd1_sign;
  uint32_t opt_opd2_sign;
  uint32_t opt_res0_int8;
  uint32_t opt_opd0_int8;
  uint32_t opt_opd1_int8;
  uint32_t opt_opd2_int8;
  uint32_t opt_opd0_const;
  uint32_t opt_opd1_const;
  uint32_t opt_opd2_const;
  uint32_t short_nchwstr_same;
  uint32_t short_res0_str;
  uint32_t short_opd0_str;
  uint32_t short_opd1_str;
  uint32_t short_opd2_str;
  uint32_t conv_opd0_x_ins0;
  uint32_t conv_opd0_y_ins0;
  uint32_t conv_opd0_x_ins0_last;
  uint32_t conv_opd0_y_ins0_last;
  uint32_t conv_opd1_x_ins0;
  uint32_t conv_opd1_y_ins0;
  uint32_t opd0_ins_val;
  uint32_t ps32_md;
  uint32_t double_conv;
  uint32_t rsvd0;
  uint32_t res0_n;
  uint32_t res0_c;
  uint32_t res0_h;
  uint32_t res0_w;
  uint32_t res0_addr;
  uint32_t opd0_addr;
  uint32_t opd1_addr;
  uint32_t rsvd1;
  uint32_t opd2_addr;
  uint32_t opd0_c;
  uint32_t opd0_h;
  uint32_t opd0_w;
  uint32_t opd1_h;
  uint32_t opd1_w;
  uint32_t conv_opd0_up_pad;
  uint32_t conv_opd0_dn_pad;
  uint32_t conv_opd0_lf_pad;
  uint32_t conv_opd0_rt_pad;
  uint32_t conv_op_x_str;
  uint32_t conv_op_y_str;
  uint32_t opd0_ins_fp;
  uint32_t rsvd2;
  uint32_t opd0_n;
  uint32_t opd1_n;
  uint32_t opd1_c;
  uint32_t opd2_n;
  uint32_t opd2_c;
  uint32_t opd2_h;
  uint32_t opd2_w;
  uint32_t quan_m;
  uint32_t opd_typ;
  uint32_t fp_round_typ;
  uint32_t rsvd7;
  uint32_t rsvd3;
  uint32_t res0_n_str;
  uint32_t res0_c_str;
  uint32_t res0_h_str;
  uint32_t res0_w_str;
  uint32_t res0_b_str;
  uint32_t opd0_n_str;
  uint32_t opd0_c_str;
  uint32_t rsvd4;
  uint32_t opd0_h_str;
  uint32_t opd0_w_str;
  uint32_t opd0_b_str;
  uint32_t opd1_n_str;
  uint32_t opd1_c_str;
  uint32_t opd1_h_str;
  uint32_t opd1_w_str;
  uint32_t rsvd5;
  uint32_t opd1_b_str;
  uint32_t opd2_n_str;
  uint32_t opd2_c_str;
  uint32_t opd2_h_str;
  uint32_t opd2_w_str;
  uint32_t opd2_b_str;
  uint32_t layer_info;
  uint32_t rsvd6;
} tiu_reg_t;

static inline void parse_tiu_reg(tiu_reg_t *r, const uint32_t *p)
{
  r->cmd_en = p[0] & 1;
  r->cmd_end = (p[0] >> 1) & 1;
  r->cmd_id_en = (p[0] >> 2) & 1;
  r->cmd_id_tpu = (p[0] >> 3) & ((1u << 16) - 1);
  r->cmd_id_gdma = (p[0] >> 19) & ((1u << 13) - 1);
  r->cmd_id_gdma |= (uint64_t)(p[1] & ((1u << 3) - 1)) << 13;
  r->cmd_keep = (p[1] >> 3) & 1;
  r->cmd_intr_en = (p[1] >> 4) & 1;
  r->tsk_typ = (p[1] >> 5) & ((1u << 4) - 1);
  r->tsk_eu_typ = (p[1] >> 9) & ((1u << 8) - 1);
  r->tsk_opd_num = (p[1] >> 17) & ((1u << 2) - 1);
  r->opt_right_shift = (p[1] >> 19) & ((1u << 5) - 1);
  r->opt_left_shift = (p[1] >> 24) & ((1u << 5) - 1);
  r->opt_shift_typ = (p[1] >> 29) & 1;
  r->opt_rshift_typ = (p[1] >> 30) & 1;
  r->opt_res_add = (p[1] >> 31) & 1;
  r->opt_relu = p[2] & 1;
  r->opt_left_tran = (p[2] >> 1) & 1;
  r->opt_chl_quan = (p[2] >> 2) & 1;
  r->tens_mdsum = (p[2] >> 3) & 1;
  r->tens_lookup = (p[2] >> 4) & 1;
  r->opt_res0_sign = (p[2] >> 5) & 1;
  r->opt_opd0_sign = (p[2] >> 6) & 1;
  r->opt_opd1_sign = (p[2] >> 7) & 1;
  r->opt_opd2_sign = (p[2] >> 8) & 1;
  r->opt_res0_int8 = (p[2] >> 9) & 1;
  r->opt_opd0_int8 = (p[2] >> 10) & 1;
  r->opt_opd1_int8 = (p[2] >> 11) & 1;
  r->opt_opd2_int8 = (p[2] >> 12) & 1;
  r->opt_opd0_const = (p[2] >> 13) & 1;
  r->opt_opd1_const = (p[2] >> 14) & 1;
  r->opt_opd2_const = (p[2] >> 15) & 1;
  r->short_nchwstr_same = (p[2] >> 16) & 1;
  r->short_res0_str = (p[2] >> 17) & ((1u << 2) - 1);
  r->short_opd0_str = (p[2] >> 19) & ((1u << 2) - 1);
  r->short_opd1_str = (p[2] >> 21) & ((1u << 2) - 1);
  r->short_opd2_str = (p[2] >> 23) & ((1u << 2) - 1);
  r->conv_opd0_x_ins0 = (p[2] >> 25) & ((1u << 4) - 1);
  r->conv_opd0_y_ins0 = (p[2] >> 29) & ((1u << 3) - 1);
  r->conv_opd0_y_ins0 |= (uint64_t)(p[3] & 1) << 3;
  r->conv_opd0_x_ins0_last = (p[3] >> 1) & ((1u << 4) - 1);
  r->conv_opd0_y_ins0_last = (p[3] >> 5) & ((1u << 4) - 1);
  r->conv_opd1_x_ins0 = (p[3] >> 9) & ((1u << 4) - 1);
  r->conv_opd1_y_ins0 = (p[3] >> 13) & ((1u << 4) - 1);
  r->opd0_ins_val = (p[3] >> 17) & ((1u << 8) - 1);
  r->ps32_md = (p[3] >> 25) & ((1u << 2) - 1);
  r->double_conv = (p[3] >> 27) & 1;
  r->rsvd0 = (p[3] >> 28) & ((1u << 4) - 1);
  r->res0_n = p[4] & ((1u << 12) - 1);
  r->res0_c = (p[4] >> 12) & ((1u << 12) - 1);
  r->res0_h = (p[4] >> 24) & ((1u << 8) - 1);
  r->res0_h |= (uint64_t)(p[5] & ((1u << 4) - 1)) << 8;
  r->res0_w = (p[5] >> 4) & ((1u << 12) - 1);
  r->res0_addr = (p[5] >> 16) & ((1u << 16) - 1);
  r->res0_addr |= (uint64_t)(p[6] & ((1u << 8) - 1)) << 16;
  r->opd0_addr = (p[6] >> 8) & ((1u << 24) - 1);
  r->opd1_addr = p[7] & ((1u << 16) - 1);
  r->rsvd1 = (p[7] >> 16) & ((1u << 16) - 1);
  r->opd2_addr = p[8] & ((1u << 16) - 1);
  r->opd0_c = (p[8] >> 16) & ((1u << 12) - 1);
  r->opd0_h = (p[8] >> 28) & ((1u << 4) - 1);
  r->opd0_h |= (uint64_t)(p[9] & ((1u << 8) - 1)) << 4;
  r->opd0_w = (p[9] >> 8) & ((1u << 12) - 1);
  r->opd1_h = (p[9] >> 20) & ((1u << 12) - 1);
  r->opd1_w = p[10] & ((1u << 12) - 1);
  r->conv_opd0_up_pad = (p[10] >> 12) & ((1u << 4) - 1);
  r->conv_opd0_dn_pad = (p[10] >> 16) & ((1u << 4) - 1);
  r->conv_opd0_lf_pad = (p[10] >> 20) & ((1u << 4) - 1);
  r->conv_opd0_rt_pad = (p[10] >> 24) & ((1u << 4) - 1);
  r->conv_op_x_str = (p[10] >> 28) & ((1u << 4) - 1);
  r->conv_op_y_str = p[11] & ((1u << 4) - 1);
  r->opd0_ins_fp = (p[11] >> 4) & ((1u << 16) - 1);
  r->rsvd2 = (p[11] >> 20) & ((1u << 12) - 1);
  r->opd0_n = p[12] & ((1u << 12) - 1);
  r->opd1_n = (p[12] >> 12) & ((1u << 12) - 1);
  r->opd1_c = (p[12] >> 24) & ((1u << 8) - 1);
  r->opd1_c |= (uint64_t)(p[13] & ((1u << 4) - 1)) << 8;
  r->opd2_n = (p[13] >> 4) & ((1u << 12) - 1);
  r->opd2_c = (p[13] >> 16) & ((1u << 12) - 1);
  r->opd2_h = (p[13] >> 28) & ((1u << 4) - 1);
  r->opd2_h |= (uint64_t)(p[14] & ((1u << 8) - 1)) << 4;
  r->opd2_w = (p[14] >> 8) & ((1u << 12) - 1);
  r->quan_m = (p[14] >> 20) & ((1u << 12) - 1);
  r->quan_m |= (uint64_t)(p[15] & ((1u << 20) - 1)) << 12;
  r->opd_typ = (p[15] >> 20) & 1;
  r->fp_round_typ = (p[15] >> 21) & ((1u << 3) - 1);
  r->rsvd7 = (p[15] >> 24) & ((1u << 4) - 1);
  r->rsvd3 = (p[15] >> 28) & ((1u << 4) - 1);
  r->res0_n_str = p[16] & ((1u << 16) - 1);
  r->res0_c_str = (p[16] >> 16) & ((1u << 16) - 1);
  r->res0_h_str = p[17] & ((1u << 16) - 1);
  r->res0_w_str = (p[17] >> 16) & ((1u << 16) - 1);
  r->res0_b_str = p[18] & ((1u << 16) - 1);
  r->opd0_n_str = (p[18] >> 16) & ((1u << 16) - 1);
  r->opd0_c_str = p[19] & ((1u << 16) - 1);
  r->rsvd4 = (p[19] >> 16) & ((1u << 16) - 1);
  r->opd0_h_str = p[20] & ((1u << 16) - 1);
  r->opd0_w_str = (p[20] >> 16) & ((1u << 16) - 1);
  r->opd0_b_str = p[21] & ((1u << 16) - 1);
  r->opd1_n_str = (p[21] >> 16) & ((1u << 16) - 1);
  r->opd1_c_str = p[22] & ((1u << 16) - 1);
  r->opd1_h_str = (p[22] >> 16) & ((1u << 16) - 1);
  r->opd1_w_str = p[23] & ((1u << 16) - 1);
  r->rsvd5 = (p[23] >> 16) & ((1u << 16) - 1);
  r->opd1_b_str = p[24] & ((1u << 16) - 1);
  r->opd2_n_str = (p[24] >> 16) & ((1u << 16) - 1);
  r->opd2_c_str = p[25] & ((1u << 16) - 1);
  r->opd2_h_str = (p[25] >> 16) & ((1u << 16) - 1);
  r->opd2_w_str = p[26] & ((1u << 16) - 1);
  r->opd2_b_str = (p[26] >> 16) & ((1u << 16) - 1);
  r->layer_info = p[27] & ((1u << 28) - 1);
  r->rsvd6 = (p[27] >> 28) & ((1u << 4) - 1);
}

static inline void emit_tiu_reg(const tiu_reg_t *r, uint32_t *_p)
{
  volatile uint32_t *p = (typeof(p))_p;
  p[27] = (r->layer_info & ((1u << 28) - 1)) |
          ((r->rsvd6 & ((1u << 4) - 1)) << 28);
  p[26] = (r->opd2_w_str & ((1u << 16) - 1)) |
          ((r->opd2_b_str & ((1u << 16) - 1)) << 16);
  p[25] = (r->opd2_c_str & ((1u << 16) - 1)) |
          ((r->opd2_h_str & ((1u << 16) - 1)) << 16);
  p[24] = (r->opd1_b_str & ((1u << 16) - 1)) |
          ((r->opd2_n_str & ((1u << 16) - 1)) << 16);
  p[23] = (r->opd1_w_str & ((1u << 16) - 1)) |
          ((r->rsvd5 & ((1u << 16) - 1)) << 16);
  p[22] = (r->opd1_c_str & ((1u << 16) - 1)) |
          ((r->opd1_h_str & ((1u << 16) - 1)) << 16);
  p[21] = (r->opd0_b_str & ((1u << 16) - 1)) |
          ((r->opd1_n_str & ((1u << 16) - 1)) << 16);
  p[20] = (r->opd0_h_str & ((1u << 16) - 1)) |
          ((r->opd0_w_str & ((1u << 16) - 1)) << 16);
  p[19] = (r->opd0_c_str & ((1u << 16) - 1)) |
          ((r->rsvd4 & ((1u << 16) - 1)) << 16);
  p[18] = (r->res0_b_str & ((1u << 16) - 1)) |
          ((r->opd0_n_str & ((1u << 16) - 1)) << 16);
  p[17] = (r->res0_h_str & ((1u << 16) - 1)) |
          ((r->res0_w_str & ((1u << 16) - 1)) << 16);
  p[16] = (r->res0_n_str & ((1u << 16) - 1)) |
          ((r->res0_c_str & ((1u << 16) - 1)) << 16);
  p[15] = ((r->quan_m >> 12) & ((1u << 20) - 1)) |
          ((r->opd_typ & 1) << 20) |
          ((r->fp_round_typ & ((1u << 3) - 1)) << 21) |
          ((r->rsvd7 & ((1u << 4) - 1)) << 24) |
          ((r->rsvd3 & ((1u << 4) - 1)) << 28);
  p[14] = ((r->opd2_h >> 4) & ((1u << 8) - 1)) |
          ((r->opd2_w & ((1u << 12) - 1)) << 8) |
          ((r->quan_m & ((1u << 12) - 1)) << 20);
  p[13] = ((r->opd1_c >> 8) & ((1u << 4) - 1)) |
          ((r->opd2_n & ((1u << 12) - 1)) << 4) |
          ((r->opd2_c & ((1u << 12) - 1)) << 16) |
          ((r->opd2_h & ((1u << 4) - 1)) << 28);
  p[12] = (r->opd0_n & ((1u << 12) - 1)) |
          ((r->opd1_n & ((1u << 12) - 1)) << 12) |
          ((r->opd1_c & ((1u << 8) - 1)) << 24);
  p[11] = (r->conv_op_y_str & ((1u << 4) - 1)) |
          ((r->opd0_ins_fp & ((1u << 16) - 1)) << 4) |
          ((r->rsvd2 & ((1u << 12) - 1)) << 20);
  p[10] = (r->opd1_w & ((1u << 12) - 1)) |
          ((r->conv_opd0_up_pad & ((1u << 4) - 1)) << 12) |
          ((r->conv_opd0_dn_pad & ((1u << 4) - 1)) << 16) |
          ((r->conv_opd0_lf_pad & ((1u << 4) - 1)) << 20) |
          ((r->conv_opd0_rt_pad & ((1u << 4) - 1)) << 24) |
          ((r->conv_op_x_str & ((1u << 4) - 1)) << 28);
  p[9] = ((r->opd0_h >> 4) & ((1u << 8) - 1)) |
         ((r->opd0_w & ((1u << 12) - 1)) << 8) |
         ((r->opd1_h & ((1u << 12) - 1)) << 20);
  p[8] = (r->opd2_addr & ((1u << 16) - 1)) |
         ((r->opd0_c & ((1u << 12) - 1)) << 16) |
         ((r->opd0_h & ((1u << 4) - 1)) << 28);
  p[7] = (r->opd1_addr & ((1u << 16) - 1)) |
         ((r->rsvd1 & ((1u << 16) - 1)) << 16);
  p[6] = ((r->res0_addr >> 16) & ((1u << 8) - 1)) |
         ((r->opd0_addr & ((1u << 24) - 1)) << 8);
  p[5] = ((r->res0_h >> 8) & ((1u << 4) - 1)) |
         ((r->res0_w & ((1u << 12) - 1)) << 4) |
         ((r->res0_addr & ((1u << 16) - 1)) << 16);
  p[4] = (r->res0_n & ((1u << 12) - 1)) |
         ((r->res0_c & ((1u << 12) - 1)) << 12) |
         ((r->res0_h & ((1u << 8) - 1)) << 24);
  p[3] = ((r->conv_opd0_y_ins0 >> 3) & 1) |
         ((r->conv_opd0_x_ins0_last & ((1u << 4) - 1)) << 1) |
         ((r->conv_opd0_y_ins0_last & ((1u << 4) - 1)) << 5) |
         ((r->conv_opd1_x_ins0 & ((1u << 4) - 1)) << 9) |
         ((r->conv_opd1_y_ins0 & ((1u << 4) - 1)) << 13) |
         ((r->opd0_ins_val & ((1u << 8) - 1)) << 17) |
         ((r->ps32_md & ((1u << 2) - 1)) << 25) |
         ((r->double_conv & 1) << 27) |
         ((r->rsvd0 & ((1u << 4) - 1)) << 28);
  p[2] = (r->opt_relu & 1) |
         ((r->opt_left_tran & 1) << 1) |
         ((r->opt_chl_quan & 1) << 2) |
         ((r->tens_mdsum & 1) << 3) |
         ((r->tens_lookup & 1) << 4) |
         ((r->opt_res0_sign & 1) << 5) |
         ((r->opt_opd0_sign & 1) << 6) |
         ((r->opt_opd1_sign & 1) << 7) |
         ((r->opt_opd2_sign & 1) << 8) |
         ((r->opt_res0_int8 & 1) << 9) |
         ((r->opt_opd0_int8 & 1) << 10) |
         ((r->opt_opd1_int8 & 1) << 11) |
         ((r->opt_opd2_int8 & 1) << 12) |
         ((r->opt_opd0_const & 1) << 13) |
         ((r->opt_opd1_const & 1) << 14) |
         ((r->opt_opd2_const & 1) << 15) |
         ((r->short_nchwstr_same & 1) << 16) |
         ((r->short_res0_str & ((1u << 2) - 1)) << 17) |
         ((r->short_opd0_str & ((1u << 2) - 1)) << 19) |
         ((r->short_opd1_str & ((1u << 2) - 1)) << 21) |
         ((r->short_opd2_str & ((1u << 2) - 1)) << 23) |
         ((r->conv_opd0_x_ins0 & ((1u << 4) - 1)) << 25) |
         ((r->conv_opd0_y_ins0 & ((1u << 3) - 1)) << 29);
  p[1] = ((r->cmd_id_gdma >> 13) & ((1u << 3) - 1)) |
         ((r->cmd_keep & 1) << 3) |
         ((r->cmd_intr_en & 1) << 4) |
         ((r->tsk_typ & ((1u << 4) - 1)) << 5) |
         ((r->tsk_eu_typ & ((1u << 8) - 1)) << 9) |
         ((r->tsk_opd_num & ((1u << 2) - 1)) << 17) |
         ((r->opt_right_shift & ((1u << 5) - 1)) << 19) |
         ((r->opt_left_shift & ((1u << 5) - 1)) << 24) |
         ((r->opt_shift_typ & 1) << 29) |
         ((r->opt_rshift_typ & 1) << 30) |
         ((r->opt_res_add & 1) << 31);
  p[0] = (r->cmd_en & 1) |
         ((r->cmd_end & 1) << 1) |
         ((r->cmd_id_en & 1) << 2) |
         ((r->cmd_id_tpu & ((1u << 16) - 1)) << 3) |
         ((r->cmd_id_gdma & ((1u << 13) - 1)) << 19);
}

static inline void reset_tiu_reg(tiu_reg_t *r)
{
  r->cmd_en = 0b0;
  r->cmd_end = 0b0;
  r->cmd_id_en = 0b0;
  r->cmd_id_tpu = 0;
  r->cmd_id_gdma = 0;
  r->cmd_keep = 0b0;
  r->cmd_intr_en = 0b0;
  r->tsk_typ = 0;
  r->tsk_eu_typ = 0;
  r->tsk_opd_num = 0b11;
  r->opt_right_shift = 10;
  r->opt_left_shift = 2;
  r->opt_shift_typ = 0b1;
  r->opt_rshift_typ = 0b1;
  r->opt_res_add = 0b0;
  r->opt_relu = 0b1;
  r->opt_left_tran = 0b0;
  r->opt_chl_quan = 0b0;
  r->tens_mdsum = 0b0;
  r->tens_lookup = 0b0;
  r->opt_res0_sign = 0b0;
  r->opt_opd0_sign = 0b0;
  r->opt_opd1_sign = 0b1;
  r->opt_opd2_sign = 0b1;
  r->opt_res0_int8 = 0b1;
  r->opt_opd0_int8 = 0b1;
  r->opt_opd1_int8 = 0b1;
  r->opt_opd2_int8 = 0b0;
  r->opt_opd0_const = 0b0;
  r->opt_opd1_const = 0b0;
  r->opt_opd2_const = 0b0;
  r->short_nchwstr_same = 0b0;
  r->short_res0_str = 0b00;
  r->short_opd0_str = 0b00;
  r->short_opd1_str = 0b00;
  r->short_opd2_str = 0b00;
  r->conv_opd0_x_ins0 = 0;
  r->conv_opd0_y_ins0 = 0;
  r->conv_opd0_x_ins0_last = 0;
  r->conv_opd0_y_ins0_last = 0;
  r->conv_opd1_x_ins0 = 0;
  r->conv_opd1_y_ins0 = 0;
  r->opd0_ins_val = 0;
  r->ps32_md = 0;
  r->double_conv = 0;
  r->rsvd0 = 0;
  r->res0_n = 1;
  r->res0_c = 1;
  r->res0_h = 1;
  r->res0_w = 16;
  r->res0_addr = 0;
  r->opd0_addr = 0;
  r->opd1_addr = 0;
  r->rsvd1 = 0;
  r->opd2_addr = 0;
  r->opd0_c = 1;
  r->opd0_h = 1;
  r->opd0_w = 16;
  r->opd1_h = 1;
  r->opd1_w = 16;
  r->conv_opd0_up_pad = 0;
  r->conv_opd0_dn_pad = 0;
  r->conv_opd0_lf_pad = 0;
  r->conv_opd0_rt_pad = 0;
  r->conv_op_x_str = 1;
  r->conv_op_y_str = 1;
  r->opd0_ins_fp = 0;
  r->rsvd2 = 0;
  r->opd0_n = 1;
  r->opd1_n = 1;
  r->opd1_c = 1;
  r->opd2_n = 1;
  r->opd2_c = 1;
  r->opd2_h = 1;
  r->opd2_w = 16;
  r->quan_m = 0;
  r->opd_typ = 0;
  r->fp_round_typ = 0;
  r->rsvd7 = 0;
  r->rsvd3 = 0;
  r->res0_n_str = 16;
  r->res0_c_str = 16;
  r->res0_h_str = 0;
  r->res0_w_str = 1;
  r->res0_b_str = 16;
  r->opd0_n_str = 16;
  r->opd0_c_str = 16;
  r->rsvd4 = 0;
  r->opd0_h_str = 0;
  r->opd0_w_str = 1;
  r->opd0_b_str = 16;
  r->opd1_n_str = 16;
  r->opd1_c_str = 16;
  r->opd1_h_str = 0;
  r->opd1_w_str = 1;
  r->rsvd5 = 0;
  r->opd1_b_str = 16;
  r->opd2_n_str = 16;
  r->opd2_c_str = 16;
  r->opd2_h_str = 0;
  r->opd2_w_str = 1;
  r->opd2_b_str = 16;
  r->layer_info = 0;
  r->rsvd6 = 0;
}

static inline void trace_tiu_reg(tiu_reg_t *r, const char *tag)
{
#define trace_one_reg(name) \
  printf("  %s: 0x%llx\n", #name, (ullong)r->name)

  printf("--- %s ---\n", tag);
  trace_one_reg(cmd_en);
  trace_one_reg(cmd_end);
  trace_one_reg(cmd_id_en);
  trace_one_reg(cmd_id_tpu);
  trace_one_reg(cmd_id_gdma);
  trace_one_reg(cmd_keep);
  trace_one_reg(cmd_intr_en);
  trace_one_reg(tsk_typ);
  trace_one_reg(tsk_eu_typ);
  trace_one_reg(tsk_opd_num);
  trace_one_reg(opt_right_shift);
  trace_one_reg(opt_left_shift);
  trace_one_reg(opt_shift_typ);
  trace_one_reg(opt_rshift_typ);
  trace_one_reg(opt_res_add);
  trace_one_reg(opt_relu);
  trace_one_reg(opt_left_tran);
  trace_one_reg(opt_chl_quan);
  trace_one_reg(tens_mdsum);
  trace_one_reg(tens_lookup);
  trace_one_reg(opt_res0_sign);
  trace_one_reg(opt_opd0_sign);
  trace_one_reg(opt_opd1_sign);
  trace_one_reg(opt_opd2_sign);
  trace_one_reg(opt_res0_int8);
  trace_one_reg(opt_opd0_int8);
  trace_one_reg(opt_opd1_int8);
  trace_one_reg(opt_opd2_int8);
  trace_one_reg(opt_opd0_const);
  trace_one_reg(opt_opd1_const);
  trace_one_reg(opt_opd2_const);
  trace_one_reg(short_nchwstr_same);
  trace_one_reg(short_res0_str);
  trace_one_reg(short_opd0_str);
  trace_one_reg(short_opd1_str);
  trace_one_reg(short_opd2_str);
  trace_one_reg(conv_opd0_x_ins0);
  trace_one_reg(conv_opd0_y_ins0);
  trace_one_reg(conv_opd0_x_ins0_last);
  trace_one_reg(conv_opd0_y_ins0_last);
  trace_one_reg(conv_opd1_x_ins0);
  trace_one_reg(conv_opd1_y_ins0);
  trace_one_reg(opd0_ins_val);
  trace_one_reg(ps32_md);
  trace_one_reg(double_conv);
  trace_one_reg(rsvd0);
  trace_one_reg(res0_n);
  trace_one_reg(res0_c);
  trace_one_reg(res0_h);
  trace_one_reg(res0_w);
  trace_one_reg(res0_addr);
  trace_one_reg(opd0_addr);
  trace_one_reg(opd1_addr);
  trace_one_reg(rsvd1);
  trace_one_reg(opd2_addr);
  trace_one_reg(opd0_c);
  trace_one_reg(opd0_h);
  trace_one_reg(opd0_w);
  trace_one_reg(opd1_h);
  trace_one_reg(opd1_w);
  trace_one_reg(conv_opd0_up_pad);
  trace_one_reg(conv_opd0_dn_pad);
  trace_one_reg(conv_opd0_lf_pad);
  trace_one_reg(conv_opd0_rt_pad);
  trace_one_reg(conv_op_x_str);
  trace_one_reg(conv_op_y_str);
  trace_one_reg(opd0_ins_fp);
  trace_one_reg(rsvd2);
  trace_one_reg(opd0_n);
  trace_one_reg(opd1_n);
  trace_one_reg(opd1_c);
  trace_one_reg(opd2_n);
  trace_one_reg(opd2_c);
  trace_one_reg(opd2_h);
  trace_one_reg(opd2_w);
  trace_one_reg(quan_m);
  trace_one_reg(opd_typ);
  trace_one_reg(fp_round_typ);
  trace_one_reg(rsvd7);
  trace_one_reg(rsvd3);
  trace_one_reg(res0_n_str);
  trace_one_reg(res0_c_str);
  trace_one_reg(res0_h_str);
  trace_one_reg(res0_w_str);
  trace_one_reg(res0_b_str);
  trace_one_reg(opd0_n_str);
  trace_one_reg(opd0_c_str);
  trace_one_reg(rsvd4);
  trace_one_reg(opd0_h_str);
  trace_one_reg(opd0_w_str);
  trace_one_reg(opd0_b_str);
  trace_one_reg(opd1_n_str);
  trace_one_reg(opd1_c_str);
  trace_one_reg(opd1_h_str);
  trace_one_reg(opd1_w_str);
  trace_one_reg(rsvd5);
  trace_one_reg(opd1_b_str);
  trace_one_reg(opd2_n_str);
  trace_one_reg(opd2_c_str);
  trace_one_reg(opd2_h_str);
  trace_one_reg(opd2_w_str);
  trace_one_reg(opd2_b_str);
  trace_one_reg(layer_info);
  trace_one_reg(rsvd6);
}
#endif /* BM1880v2_TIU_REG_V2_11_H */
